import { observable , action } from 'mobx';
import Cookie from 'js-cookie';
import Util from '../lib/commonJs';
import { Icon } from "antd";
import React from "react";

let store = null;

class Store {

    @observable blockHigh = "-";
    @action setBlockHigh = (high)=>{
        this.blockHigh = high;
    };
    @action getBlockHigh = ()=>{
        return this.blockHigh;
    };




    // @observable serverHost = "http://10.1.3.153:8080";
    @observable serverHost = "/explorer";

    @observable peerList = [];

    @observable lastUpdate = 0;

    @observable activeIP = "";

    @observable settings = {
	BLOCK_HIGH_ERR_TIMES:3,     //设置发生错误次数之后 终止循环获取块高度
	BLOCK_LIST_ERR_TIMES:3,     //设置发生错误次数之后 终止循环获取块集合
	GET_BLOCK_HIGH_TIME:110000,  //循环获取块高度 循环时间间隔
	GET_BLOCK_LIST_TIME:120000,  //循环获取块集合 循环时间间隔
	TX_TOTAL:10,                //显示交易数据条数
	BLOCK_TOTAL:6,              //显示块条数

	GET_TX_TIME:110000,  //循环获取交易的间隔时间
	SHOW_TX_LIST:6      //显示交易条数
    };

}
export default store === null?new Store():store;

/*
export default ()=>{
    if (store === null) {
	store = new Store();
    }
    return store
}*/
